<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%@ include file="/WEB-INF/jsp/header.jsp" %>

<script language="JavaScript"> 
	document.getElementById('finder').style.display = 'block';
</script>


<%@ include file="/WEB-INF/jsp/partnerTools.jsp" %>

<h2> Hospitals </h2>
</center>
This page show list of hospitals available in current battles.<br/>
<br/>
<u>Note</u> that, everyone can heal in those hospitals, even if it's located in hostile territory. 
All you have to do is to travel to the country, where hospital is available and quickly heal (usually hospitals last for less than 10 sec.!)
<br/>
<br/>
<font color="ff0000">This site shows data which is few minutes old. <br/>
Remember to check if the hospital is still available before wasting ticket (click on the region name to see fresh data)</font>
<br/>
<br/>
<center>
<form action="#">
	<input type="submit" value="refresh" />
</form>

<%@ include file="/WEB-INF/jsp/commercials.jsp" %>









<table width="800" border="2" cellpadding="2" cellspacing="0" bordercolor="777777" width="800" style="text-align: center; font-size: 11px">
	<tr>
		<td width="150">Sides</td> <td width="150">Hospital available in:</td>  <td  width="150">Hospital details</td>  <td  width="350" colspan="3">Available in countries</td>
	</tr>
	
	<tr>
		<td width="150"></td> <td width="150"></td>  <td  width="150"></td>  <td  width="125">Eden</td> <td  width="125">Phoenix</td> <td  width="100">Neutral</td>
	</tr>
	
	<c:if test="${ fn:length(hospitals) == 0}">
				<tr><td colspan="6"> <h3>No hospitals are available </h3> </td></tr>
	</c:if>
	
	<c:forEach var="hospital" items="${hospitals}" >
	<tr>
		<td>	
			<img src="http://www.erepublik.com/images/flags/XL/<c:out value="${hospital.battle.attacker.urlName}"/>.gif"/> 
				vs
			<img src="http://www.erepublik.com/images/flags/XL/<c:out value="${hospital.battle.defender.urlName}"/>.gif"/> 

			<br/>
			
			<c:if test="${hospital.battle.resistance == false}">
				(<c:out value="${ fn:length(hospital.battle.attackersAllies) }"/> allies) | (<c:out value="${ fn:length(hospital.battle.defendersAllies) }"/> allies)<br/>
			</c:if>
			
			
			<c:if test="${hospital.battle.resistance == true}">
				Resistance war<br/>
			</c:if>
			
			<a href="http://www.erepublik.com/en/region/<c:out value="${hospital.regionNameWithDash}"/>" target="_blank"> ${hospital.regionName} </a><br/>
			<br/>
			<a href="http://www.erepublik.com/en/military/battlefield/<c:out value="${hospital.battle.id}"/>" target="_blank"> Go to battle </a>
			
		</td> 
		<td>
			<h3><c:out value="${hospital.remainingTimeAsString}"/></h3>
		</td>  
		<td >
			total wellness: <c:out value="${hospital.wellness}"/><br/>
			wellness per player: <c:out value="${hospital.wellnessPerPlayer}"/><br/>
		</td> 
		<td width="125" style="background: none repeat scroll 0% 0% rgb(182, 243, 162);">
			<c:forEach var="country" items="${hospital.availableEdenCountries}" >
				<img src="http://www.erepublik.com/images/flags/M/<c:out value="${country.urlName}"/>.gif"/> 
			</c:forEach>
		</td>
		<td width="125" style="background: none repeat scroll 0% 0% rgb(242, 183, 162);">
			<c:forEach var="country" items="${hospital.availablePhoenixCountries}" >
				<img src="http://www.erepublik.com/images/flags/M/<c:out value="${country.urlName}"/>.gif"/> 
			</c:forEach>
		</td>
		<td width="100" style="background: none repeat scroll 0% 0% rgb(242, 243, 202);">
			<c:forEach var="country" items="${hospital.availableNeutralCountries}" >
				<img src="http://www.erepublik.com/images/flags/M/<c:out value="${country.urlName}"/>.gif"/> 
			</c:forEach>
		</td>
		
		
	</tr>
	</c:forEach>
	
</table>


<%@ include file="/WEB-INF/jsp/bottom.jsp" %>

